package example.springdata.mongodb.people;

//@Configuration
//@EnableReactiveMongoRepositories
//@EnableConfigurationProperties(MongoProperties.class)
//@RequiredArgsConstructor
//@Slf4j
public class MongoConfiguration {//extends AbstractReactiveMongoConfiguration {
//    private final MongoProperties mongoProperties;
//    private final ConfigurableEnvironment env;
//
//    @Override
//    protected String getDatabaseName() {
//        return mongoProperties.getMongoClientDatabase();
//    }
//
//    @Override
//    @Bean(destroyMethod = "close")
//    public MongoClient reactiveMongoClient() {
//        Integer localPort = env.getProperty("local.mongo.port", Integer.class);
//
//        if (nonNull(localPort)) {
//            log.debug("Found embedded Mongo running on port: {}.", localPort);
//            return MongoClients.create(String.format("mongodb://localhost:%d/%s", localPort, getDatabaseName()));
//        }
//
//        return MongoClients.create(mongoProperties.determineUri());
//    }
//
////    @Profile("embedded")
//    @Configuration
//    @Import({EmbeddedMongoAutoConfiguration.class})
//    public static class EmbeddedMongoConfiguration {
//    }
}